<?php
require_once 'Zend/Db.php';
class ResourcesProvider {

	public static function getResourcesPairs() {

		$registry = Zend_Registry :: getInstance();
		$config = $registry->config;

		$db = Zend_Db :: factory('Mysqli', array (
			'host' => $config->database->host,
			'username' => $config->database->username,
			'password' => $config->database->password,
			'dbname' => $config->database->name
		));
		$db->setFetchMode(Zend_Db :: FETCH_OBJ);
		$result = $db->fetchPairs('SELECT RESOURCE_ID AS ID, RESOURCE_NOMBRE AS NOMBRE FROM RESOURCE');
		return $result;
	}
}
?>